www.gusucode.com > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信 > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信关键技术,了解数字通信系统仿真流程,实现基本的信道编译码、调制解调等通信模块。(好评如潮,课设拿满) 学习并实现MIMO空时处理技术 学习性能分析的思路和方法/mimo/matlab for mimo 2x2/synchronize.m

    function t_samp = synchronize(rA_I, rA_Q, rB_I, rB_Q, tr_sync_I, tr_sync_Q , M_sync, L, ts);
% Function synchronize
% By Maxime Maury
% 05-04-21
% Inputs:
%   rA:         received symbols on antenna A
%   rB:         received symbols on antenna B
%   tr_sync_I:  Training sequence sent for synchronization
%   M_sync:     Length of the analysis window
%   L:          Upsampling factor
%   ts:         Start of the analysis window
% Output:
%   t_samp:     best timing instant at the output of the match filter

training_s_len = length(tr_sync_I);

for k = 1:M_sync
     correlA_I = rA_I(k+ts:L:k+ts+training_s_len*L-1).*[tr_sync_I];
     correlA_Q = rA_Q(k+ts:L:k+ts+training_s_len*L-1).*[tr_sync_Q];
     correlB_I = rB_I(k+ts:L:k+ts+training_s_len*L-1).*[tr_sync_I];
     correlB_Q = rB_Q(k+ts:L:k+ts+training_s_len*L-1).*[tr_sync_Q];

     sync(k) = abs(sum(correlA_I+correlB_I))^2 + abs(sum(correlA_Q+correlB_Q))^2;
end    

[maximum,t_samp] = max(sync);

plot(sync);
hold on;
plot(t_samp,sync(t_samp),'hr');

t_samp = t_samp + ts;